package com.zqz.admin.server.config;

import org.apache.shiro.cache.ehcache.EhCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ehcache配置
 * @author: zqz
 * @date: 2022/5/29 13:40
 */

@Configuration
public class EhCacheConfig {
  /*ehcache是用来管理缓存的一个工具,其缓存的数据可以放在内存里面,也可以放在硬盘上 不适合用于集群上 用于集群上还得看redis*/
	@Bean("ehCacheManager")
	public EhCacheManager cacheManager() {
		EhCacheManager cacheManager = new EhCacheManager();
		cacheManager.setCacheManagerConfigFile("classpath:ehcache.xml");

		return cacheManager;
	}
}
